package com.fh.service.building;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.fh.dao.DaoSupport;
import com.fh.entity.Page;
import com.fh.util.PageData;


@Service("buildingService")
public class BuildingService {

	@Resource(name = "daoSupport")
	private DaoSupport dao;
	
	/*
	* 新增
	*/
	public void save(PageData pd)throws Exception{
		dao.save("BuildingMapper.save", pd);
	}
	
	/*
	* 删除
	*/
	public void delete(PageData pd)throws Exception{
		dao.delete("BuildingMapper.delete", pd);
	}
	
	/*
	* 修改
	*/
	public void edit(PageData pd)throws Exception{
		dao.update("BuildingMapper.edit", pd);
	}
	
	/*
	*列表
	*/
	public List<PageData> list(Page page)throws Exception{
		return (List<PageData>)dao.findForList("BuildingMapper.datalistPage", page);
	}
	
	/*
	*列表(全部)
	*/
	public List<PageData> listAll(PageData pd)throws Exception{
		return (List<PageData>)dao.findForList("BuildingMapper.listAll", pd);
	}
	/*
	*统计首页 楼宇信息 ajax请求
	*/
	public List<PageData> listArr(PageData pd)throws Exception{
		return (List<PageData>)dao.findForList("BuildingMapper.listArr", pd);
	}
	/*
	*首页列表(全部)
	*/
	public List<PageData> listArrjson(Page page)throws Exception{
		return (List<PageData>)dao.findForList("BuildingMapper.listArr", page);
	}
	
	/*
	* 通过id获取数据
	*/
	public PageData findById(PageData pd)throws Exception{
		return (PageData)dao.findForObject("BuildingMapper.findById", pd);
	}
	
	/*
	* 批量删除
	*/
	public void deleteAll(String[] ArrayDATA_IDS)throws Exception{
		dao.delete("BuildingMapper.deleteAll", ArrayDATA_IDS);
	}

	/*
	* 获取楼宇信息select选择框
	 */
	public List<PageData> getBuildings(PageData pd) throws  Exception{
		return (List<PageData>) dao.findForList("BuildingMapper.getBuildings",pd);
	}
	/* ===============================app接口================================= */
	/*
	*楼宇接口
	*/
	/*public List<PageData> listBuildingApp(PageData pd)throws Exception{
		return (List<PageData>)dao.findForList("BuildingMapper.listBuildingApp", pd);
	}*/

	public List<PageData> listBuildingApp(Page page)throws Exception{
		return (List<PageData>)dao.findForList("BuildingMapper.datalistPageBuildingApp", page);
	}

	/*
	*楼宇详情接口
	*/
	public List<PageData> Buildingdetail(PageData pd)throws Exception{
		return (List<PageData>)dao.findForList("BuildingMapper.Buildingdetail", pd);
	}
	/*
	*账单详情接口 拼接 本月水费
	*/
	public List<PageData> Billdetail(PageData pd)throws Exception{
		return (List<PageData>)dao.findForList("BuildingMapper.Billdetail", pd);
	}
	/*
	*账单详情接口 拼接 本月电费
	*/
	public List<PageData> BillELE(PageData pd)throws Exception{
		return (List<PageData>)dao.findForList("BuildingMapper.BillELE", pd);
	}
	/*
	*账单详情接口 拼接 本月收入
	*/
	public List<PageData> BillINPUT(PageData pd)throws Exception{
		return (List<PageData>)dao.findForList("BuildingMapper.BillINPUT", pd);
	}
	/*
	*账单详情接口 拼接 已租房间数
	*/
	public List<PageData> RoomROOMED(PageData pd)throws Exception{
		return (List<PageData>)dao.findForList("BuildingMapper.RoomROOMED", pd);
	}
	/*
	*房间基本 信息
	*/
	public List<PageData> Roomdetail(PageData pd)throws Exception{
		return (List<PageData>)dao.findForList("BuildingMapper.roomdetail", pd);
	}

}

